package com.example.springstudy.entity;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

import javax.validation.constraints.NotBlank;
import java.util.ArrayList;
import java.util.Date;

/**
 * @author jiujiu
 * @ConfigurationProperties 告诉SpringBoot 容器在配置文件中找到对于的属性，映射到此类
 * prefix表示为配置文件的前缀名
 *
 */
@Data
@Component
@ConfigurationProperties(prefix = "car")
public class Car {
    @NotBlank(message = "姓名不可以为空")
    private String name;
    private Integer year;
    private String remarks;
    private ArrayList<String> list;
    private Date minDate;
}
